<?php

/**
 * @file   admin.php
 * @date   2017-11-15 15:22:57
 * @author huwhis<huuwhois>
 * @version  0.0.1
 */

namespace app\admin\model;

use think\Model;

class BlogCategory extends Model
{
    public static function getCategories($map = [])
    {
        return self::where('status', 1)->where($map)->field('id, name, navigator')->order('sort')->select();
    }

    public function getCateName($id)
    {
        return $this->where('id', $id)->value('name');
    }
}
